import request from "@/utils/request";
//远程搜索地址
export const regionSearch = params => {
  return request({
    url: `/dbo/region/search`,
    method: "get",
    params
  });
};

// 分页查询
export function getList(params) {
  return request({
    url: "/dbo/tenant/pageList",
    params
  });
}
// 新增
export function add(data) {
  return request({
    url: "/dbo/tenant/add",
    method: "post",
    data
  });
}
// 编辑
export function edit(data) {
  return request({
    url: `/dbo/tenant/update/${data.tenantId}`,
    method: "put",
    data
  });
}
// 禁用
export function disable(id, status) {
  return request({
    url: `/dbo/tenant/updateStatus/${id}`,
    method: "put",
    data: { status }
  });
}
//  续费
export function renewal(id, data) {
  return request({
    url: `/dbo/tenant/renew/${id}`,
    method: "post",
    data
  });
}

// 租户详情
export function detail(id) {
  return request({
    url: `/dbo/tenant/detail/${id}`
  });
}

// 省市区
export function getArea() {
  return request({
    url: "/dbo/region/tree"
  });
}

// 商家等级选择列表查询
export const selectList = params => {
  return request({
    url: "/purchase/business/level/selectList",
    method: "get",
    params
  });
};

// 商家开拓渠道-下拉列表查询
export const channelSelectList = params => {
  return request({
    url: "/purchase/channel/manage/select/list",
    method: "get",
    params
  });
};

// 工厂开拓渠道-下拉列表查询
export const supplyChainSelectList = params => {
  return request({
    url: "/purchase/supplyChain/manage/select/list",
    method: "get",
    params
  });
};

// 查询所有代理商下拉列表
export const agencyManageList = params => {
  return request({
    url: "/mall/agent/agency/manage/select/list",
    method: "get",
    params
  });
};

// 查询代理商下面的所有启用人员下拉列表
export const agentUserList = params => {
  return request({
    url: "/mall/agent/tenant/user/select/list",
    method: "get",
    params
  });
};


